<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  <link rel="stylesheet" href="/static/admin/layuiadmin/layui/css/layui.css" media="all" />
  <link rel="stylesheet" href="/static/admin/css/admin_global.css" />
  <link rel="stylesheet" href="/static/admin/plugin/select2/css/select2.min.css" />
  <!--公共必要的JS-->
  <script src="/static/admin/js/check.js"></script>
  <script src="/static/admin/layuiadmin/layui/layui.js"></script>
  <script src="/static/js/jquery-3.6.2.min.js"></script>
  <script src="/static/js/crypto-js.min.js"></script>
  <script src="/static/admin/js/global.js"></script>
  <!--省市区-->
  <script src="/static/admin/plugin/shengshiqu/distpicker.data.js"></script>
  <script src="/static/admin/plugin/shengshiqu/distpicker.js"></script>
  <!--编辑器开始-->
  <script src="/static/admin/plugin/ueditor/ueditor.config.js"></script>
  <script src="/static/admin/plugin/ueditor/ueditor.all.js"></script>
  <!--编辑器结束-->
  <!---百度地图-->
  <script src="/static/admin/plugin/baidumap/setpoint.js"></script>
  <!--文件上传 start-->
  <script src="/static/admin/plugin/webuploader/kinderfile.js"></script>
  <script src="/static/admin/plugin/webuploader/Sortable.js"></script>
  <script src="/static/admin/plugin/webuploader/morepic.js"></script>
  <!--以下是针对 快速上传单个文件插件-->
  <link rel="stylesheet" href="/static/admin/plugin/webuploader/style/webuploader.css" />
  <link rel="stylesheet" href="/static/admin/plugin/webuploader/style/style.css" />
  <script src="/static/admin/plugin/webuploader/webuploader.min.js"></script>
  <script src="/static/admin/plugin/webuploader/fastupimg.js"></script>
  <!--文件上传 end-->
  <!--文件上传的预览功能中中也需要用到我 fancybox plus start-->
  <link rel="stylesheet" href="/static/admin/plugin/fancybox/jquery.fancybox-1.3.4.vot.css" />
  <script src="/static/admin/plugin/fancybox/jquery.fancybox-1.3.4.vot.js"></script>
  <!--文件上传的预览功能中中也需要用到我 fancybox plus end-->
  <!--select2 js start-->
  <link rel="stylesheet" href="/static/admin/plugin/select2/css/select2.min.css" />
  <script src="/static/admin/plugin/select2/js/select2.full.min.js"></script>
  <!--select2 js end-->
</head>
<body>
<form action="{:url()}" class="layui-form layui-form-pane padding-top-20" method="post" onsubmit="return save_form(this,successFun);">
  <div class="layui-card">
    <div class="layui-card-body" style="padding-bottom: 80px">
      <div style="display: flex;flex-flow: row wrap;padding: 20px;">
        <a href="{:url('admin/Article/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="文章"> 文章({:$r.article})</a>
        <a href="{:url('admin/Site/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="站点"> 站点({:count($r->site)})</a>
        <a href="{:url('admin/PushPlan/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="计划"> 计划({:count($r->pushPlan)})</a>
        <a href="{:url('admin/GptRequestLog/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="gpt请求日志">  gpt请求日志({$r->gptRequestLog})</a>
        <a href="{:url('admin/PushLog/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="发布日志"> 发布日志({$r->pushLog})</a>
        <a href="{:url('admin/MemberLoginLog/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="登录日志"> 登录日志({$r->memberLoginLog})</a>
        <a href="{:url('admin/Orders/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="充值明细"> 充值明细({$r->orders})</a>
        <a href="{:url('admin/MemberPointsLog/list',['member__id'=>input('id')])}"  class="layui-btn layui-btn-primary  iframe" data-height="90%" data-width="90%" data-title="积分明细">  积分明细({$r->memberPointsLog})</a>
      </div>
      <div id="content-wrapper" style="width: 80%;margin-left: 5%">



        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">昵称</label>
          <div class="layui-input-block">
            <input readonly type="text" name="member__name" id="member__name" autocomplete="false" class="layui-input" placeholder="请输入昵称" value="{$r['name']}" />
          </div>
        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">手机号</label>
          <div class="layui-input-block">
            <input  readonly type="text" name="member__phone" id="member__phone" autocomplete="false" class="layui-input" placeholder="请输入手机号" value="{$r['phone']}" />
          </div>
        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">邮箱</label>
          <div class="layui-input-block">
            <input readonly type="text" name="member__email" id="member__email" autocomplete="false" class="layui-input" placeholder="请输入邮箱" value="{$r['email']}" />
          </div>
        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">积分</label>
          <div class="layui-input-block">
            <input readonly type="text" name="member__point_num" id="member__point_num" autocomplete="false" class="layui-input" placeholder="请输入积分" value="{$r['point_num']}" />
          </div>
        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">微信openid</label>
          <div class="layui-input-block">
            <input readonly type="text" name="member__union_id" id="member__union_id" autocomplete="false" class="layui-input" placeholder="请输入微信openid" value="{$r['union_id']}" />
          </div>
        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">头像</label>
          <div class="layui-input-block">
            <img src="{$r['avatar']}" alt="" style="width: 60px">
          </div>

        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">省</label>
          <div class="layui-input-block">
            <input readonly type="text" name="member__province" id="member__province" autocomplete="false" class="layui-input" placeholder="请输入省" value="{$r['province']}" />
          </div>
        </div>
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">地址</label>
          <div class="layui-input-block">
            <input readonly type="text" name="member__address" id="member__address" autocomplete="false" class="layui-input" placeholder="请输入地址" value="{$r['address']}" />
          </div>
        </div>

        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">注册方式</label>
          <div class="layui-input-block">
            <input readonly type="text" autocomplete="false" class="layui-input" placeholder="请输入地址" value="{$r['is_mobile_registration']?'小程序':'电脑端'}" />
          </div>
        </div>

        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">注册ip</label>
          <div class="layui-input-block">
            <input readonly type="text" autocomplete="false" class="layui-input" placeholder="请输入地址" value="{$r['ip']}" />
          </div>
        </div>

        {if !$r.is_mobile_registration && $r.visit}
        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">来源</label>
          <div class="layui-input-block">
            <input readonly type="text" autocomplete="false" class="layui-input"  value="{$r.visit.source_type}" />
          </div>
        </div>

        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">搜索词</label>
          <div class="layui-input-block">
            <input readonly type="text" autocomplete="false" class="layui-input" value="{$r.visit.searchword}" />
          </div>
        </div>

        <div class="layui-form-item" style="position: relative">
          <label class="layui-form-label">用户画像</label>
          <div class="layui-input-block">
            <a href="https://www.ai-dog.net/jijincms/Visit/portrait.html?visitor_id={$r.visit.visitor_id}" class="layui-btn" target="_blank">用户画像</a>
          </div>
        </div>
        {/if}


        <input type="hidden" value="{$r.pubid}" name="pubid" />
        <input type="hidden" value="{$r.member__pubid}" name="member__pubid" />
        <input type="hidden" value="{$r.member__pubid}" name="pubid" />
        <input type="hidden" name="member__id" value="{:input('member__id')}" />
      </div>
      <div class="flex-center submit-footer">
<!--        <button class="layui-btn" type="submit" lay-submit id="layui-submit-btn">立即提交</button>-->
        <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
        <button type="reset" class="layui-btn layui-btn-primary" onclick="vlogin({$r.id})">模拟登录</button>
      </div>
    </div>
  </div>
</form>
<script>
  $(function () {
    //循环实例化编辑器
    $(".news_editor").each(function(){
      var editor_name=$(this).attr("editor_name");
      var editor_width=$(this).attr("editor_width");
      var editor_height=$(this).attr("editor_height");
      var imgwidth=$(this).attr("imgwidth");
      var imgheight=$(this).attr("imgheight");
      var ue = UE.getEditor(editor_name, {
        initialFrameHeight: editor_height>0?editor_height:"0",
        initialFrameWidth: editor_width>0?editor_width:'100%',
        zIndex:1,
        imgwidth: imgwidth,
        imgheight: imgheight,
      });
      //启用抓取微信文章功能
      if(editor_name=="newstext"){
        $(".subWxCrawler").show();
      }
    })

  })
</script>
<!--编辑器结束-->
<!---百度地图-->
<script>
  $(".baidu_map_field").each(function(){
    var baidu_map=new baidumap();
    baidu_map.map_search_value_id=$(this).find(".map_search_value").attr("id");
    baidu_map.map_search_button_id=$(this).find(".map_search_button").attr("id");
    baidu_map.map_field_id=$(this).find(".map_point").attr("id");
    baidu_map.map_show_id=$(this).find(".map_show").attr("id");
    baidu_map.showPoint=0;//如果修改信息的话需要显示之前的标记，这里请设置1  增加信息设置0
    //启动地图显示区方法
    baidu_map.newmap();
    //启动地址模糊搜索方法
    baidu_map.map_search();
    //启动鼠标点击拾取坐标方法
    baidu_map.map_position();
  })
</script>
<script>
  $(function(){
    $(".thischeck_all").click(function(){
      var y=$(this).attr("val");
      var objname=$(this).attr("objname");
      if(y==0){
        $("."+objname).prop("checked", false);
        y=1;
      }else if(y==1){
        $("."+objname).prop("checked", true);
        y=0;
      }
      $(this).attr("val",y);
    })
  })

  //排序
  function update_order(obj,inputname){
    $("input[name='"+inputname+"']").val($(obj).val());
  }
  //layer


  let laydate = layui.laydate;
  let form = layui.form;
  //时间控件
  $(".form-date").each(function(){
    let dataFormat=$(this).data("format");
    let type = $(this).data('type');
    dataFormat=dataFormat?dataFormat:"yyyy-MM-dd";
    type = type ? type : 'date'
    laydate.render({
      type: type,
      elem:this,
      calendar: true,
      trigger: 'click',
      format: dataFormat //可任意组合
    });
  });

  $(".form-time").each(function(){
    let dataFormat=$(this).data("format");
    let type = $(this).data('type');
    dataFormat=dataFormat?dataFormat:"yyyy-MM-dd HH:mm:ss";
    type = type ? type : 'datetime'
    laydate.render({
      type: type,
      elem:this,
      calendar: true,
      trigger: 'click',
      format: dataFormat //可任意组合
    });
  });

  $('.select2').select2();

  //模型切换
  function urlgo(obj){
    $val=$(obj).val();
    window.location.href='/admin/Cat/add.html?modelid='+$val;
  }

  //多值字段
  function morevalue_add(obj,str){
    var randStr2=randStr();
    for (var i=0; i<30;i++){
      //一次替换三次randImgId，因为一个上传窗口需要替换id="randImgId" 和button里的selectfile('randImgId','','img','','')
      if(i%3==0){
        randStr2=randStr();
      }
      str = str.replace('randImgId',"img_"+randStr2);
      str = str.replace('randFileId',"file_"+randStr2);
      str = str.replace('randVideoId',"video_"+randStr2);
    }
    $(obj).parents("tr").after(str);
  }
  function morevalue_del(obj){
    var len=$(obj).parents("tbody").children().length;
    if(len==1){
      alert("至少要保留一行数据");
      return false;
    }
    $(obj).parents("tr").remove();
  }
  //多值-图片预览
  function morevaluePreImg(id){
    var src=$("#"+id).val();
    $.fancybox({href:src});
  }
  //多值-文件预览
  function morevaluePreFile(id){
    var src=$("#"+id).val();
    window.open(src);
  }
  //多值-视频预览
  function morevaluePreVideo(id){
    var src=$("#"+id).val();
    if(src){
      $.fancybox({
        content:'<div class="fancybox_video_play"><video  style="width:800px;height:auto" id="fancybox_video_src" src="'+src+'" autoplay controls></video></div>',
      })
    }else{
      layer.msg("视频路径为空");
    }
  }
  //多值-textarea点击放大的效果
  function moreBigTextarea(obj,type){
    layer.prompt({
      title:"内容编辑区域",
      formType: type,//1, //输入框类型，支持0（文本）默认1（密码）2（多行文本）
      area: ['400px', '240px'],
      value: $(obj).val(),
      btn:['确认']
    },function(value, index, elem){
      $(obj).val(value);
      layer.close(index);
    });
  }
</script>
<script id="save_form">
  function successFun(){
    parent.location.reload();
  }
  function vlogin(id) {
    $.get('/admin/member/vlogin?id=' + id, function(res){
      window.open(res);
    })
  }
</script>
<script id="js_script">

</script>
</body>
</html>
